A look at the latest Jedlovec House eletricity usage and solar production from PPL and Enphase.
Load packages
library(tidyverse)
library(lubridate)
library(hms)
library(readxl)
library(onlineBcp)
Load PPL data
col_datatypes <- c('numeric','numeric','date','text',rep('numeric',99))
hourly1 <- read_excel("Hourly Usage 220326 to 220624.xlsx", col_types = col_datatypes)
Warning: Expecting numeric in A277 / R277C1: got 'The information contained in this file is intended for the confidential use by the customer and third parties authorized by the customer to receive the information. Any unauthorized use is prohibited.'
hourly2 <- read_excel("Hourly Usage 220625 to 230623.xlsx", col_types = col_datatypes)
Warning: Expecting numeric in A1096 / R1096C1: got 'The information contained in this file is intended for the confidential use by the customer and third parties authorized by the customer to receive the information. Any unauthorized use is prohibited.'
hourly3 <- read_excel("PPL 230624 to 240509.xlsx", col_types = col_datatypes)
Warning: Expecting numeric in A967 / R967C1: got 'The information contained in this file is intended for the confidential use by the customer and third parties authorized by the customer to receive the information. Any unauthorized use is prohibited.'
#hourly1
#hourly2
#hourly3
ppl_15mins <- bind_rows(hourly1,list(hourly2,hourly3))
ppl_15mins %>% arrange(desc(Date), `Read Type`)
NA
NA
Transform PPL Data
hourly_ppl_pivot <- ppl_15mins %>%
rename(date = Date) %>%
pivot_longer(!c("Account Number", "Meter Number", date, "Read Type", Min, Max, Total), names_to = "time", values_to = "kWh")
rename(ppl_15mins, date = Date)
hourly_ppl_pivot <- hourly_ppl_pivot %>%
mutate(time = parse_time(time, '%H:%M %p'), month = month(date, label=TRUE), year = year(date), yday = yday(date), wday = wday(date, label=TRUE))
(hourly_ppl_net <- hourly_ppl_pivot %>%
filter(`Read Type` == "kWh Net"))
Load Enphase data
import <- read_csv("enphase_history_230701.csv")
Rows: 42432 Columns: 2── Column specification ──────────────────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (1): Date/Time
dbl (1): Energy Produced (Wh)
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
update <- read_csv("hourly_generation_230625_240510.csv")
Rows: 30816 Columns: 2── Column specification ──────────────────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (1): Date/Time
dbl (1): Energy Produced (Wh)
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
update <- update %>%
mutate(`Date/Time` = as.POSIXct(`Date/Time`,format="%m/%d/%Y %H:%M",tz=Sys.timezone())) %>%
filter(`Date/Time` >= as.POSIXct('07/01/2023 00:00',format="%m/%d/%Y %H:%M",tz=Sys.timezone()) )
import <- import %>%
mutate(`Date/Time` = as.POSIXct(`Date/Time`,format="%m/%d/%Y %H:%M",tz=Sys.timezone()))
full_hist <- rbind(import,update)
full_hist %>% arrange(desc(`Date/Time`))
(hourly_production <- full_hist %>%
rename(datetime = `Date/Time`, energy_produced_Wh = `Energy Produced (Wh)`) %>%
mutate(datetime = as.POSIXct(datetime,format="%m/%d/%Y %H:%M",tz=Sys.timezone())) %>%
mutate(date = date(datetime), time = as.hms(format(datetime, format = "%H:%M:%S")), month = month(datetime, label=TRUE), year = year(datetime), day = day(datetime), yday = yday(datetime), monthday = format(datetime, "%m-%d"), wday = wday(datetime, label=TRUE), equinox_day = (yday + 10) %% 365, equinox_group = floor((equinox_day+15)/30)*30)
)
NA
Spot-check Enphase Should see lifetime production by day and by hour
ggplot(hourly_production, aes(datetime, energy_produced_Wh)) +
geom_point()
ggplot(hourly_production, aes(time, energy_produced_Wh)) +
theme(axis.text.x = element_text(angle = 90)) +
geom_point()
Net + Produced = Consumed
# hourly_ppl_net <- hourly_ppl_net %>% mutate(date = as_date(date))
#hourly_ppl_net %>% arrange(desc(date))
#hourly_production %>% arrange(desc(date))
(hourly_electricity <- hourly_ppl_net %>%
inner_join(hourly_production, by = join_by(date,time)) %>%
mutate(consumed_kWh = kWh + energy_produced_Wh/1000, produced_kWh = energy_produced_Wh/1000) %>%
rename(net_kWh = kWh) %>%
select(datetime, date, time, net_kWh, produced_kWh, consumed_kWh) %>%
arrange(date))
NA
Calculate production for first year of solar panels, second year, etc.
hourly_electricity <- hourly_electricity %>%
mutate(solar_year = factor(case_when(
datetime < as.POSIXct('04/16/2022 00:00',format="%m/%d/%Y %H:%M",tz=Sys.timezone()) ~ 0,
datetime >= as.POSIXct('04/16/2022 00:00',format="%m/%d/%Y %H:%M",tz=Sys.timezone()) &
datetime < as.POSIXct('04/16/2023 00:00',format="%m/%d/%Y %H:%M",tz=Sys.timezone()) ~ 1,
datetime >= as.POSIXct('04/16/2023 00:00',format="%m/%d/%Y %H:%M",tz=Sys.timezone()) &
datetime < as.POSIXct('04/16/2024 00:00',format="%m/%d/%Y %H:%M",tz=Sys.timezone()) ~ 2,
TRUE ~ 3)
)) %>%
mutate(yday = yday(date))
hourly_electricity %>%
group_by(solar_year) %>%
summarize(net_kWh = sum(net_kWh), produced_kWh = sum(produced_kWh), consumed_kWh = sum(consumed_kWh))
NA
Interesting! Produced kWh went down by 5%, but consumed kWh went down by 10% despite the fact that we got an electric car! Let’s explore that further.
daily_electricity <- hourly_electricity %>%
group_by(solar_year, yday) %>%
summarize(net_kWh = sum(net_kWh), produced_kWh = sum(produced_kWh), consumed_kWh = sum(consumed_kWh))
`summarise()` has grouped output by 'solar_year'. You can override using the `.groups` argument.
ggplot(daily_electricity, aes(yday, consumed_kWh, group=solar_year, color=solar_year)) +
geom_point() +
geom_smooth(span=0.3) +
scale_x_continuous(breaks = c(1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335), labels = month.abb) +
theme(axis.text.x = element_text(angle = 90))
Daily totals
daily_electricity <- hourly_electricity %>%
mutate(solar_day = interval(as_date(as.POSIXct('04/15/2022',format="%m/%d/%Y",tz=Sys.timezone())),as_date(date)) / days(1)
) %>%
group_by(date, solar_day) %>%
summarize(net_kWh = sum(net_kWh), produced_kWh = sum(produced_kWh), consumed_kWh = sum(consumed_kWh))
`summarise()` has grouped output by 'date'. You can override using the `.groups` argument.
ggplot(daily_electricity, aes(date, consumed_kWh)) +
geom_point() +
#scale_x_continuous(breaks = c(1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335), labels = month.abb) +
theme(axis.text.x = element_text(angle = 90))
NA
NA
Look how our electricity consumption got much less predictable, more uneven, after we purchased an EV and installed a level 2 charger in late January/early February 2023!
Also, a couple of outlier high points in Dec 2022 before we got the EV… hmm.
We probably need to filter out the EV charging and compare that separately.
Average consumption based on time of day
#hourly_electricity %>% summarize(min_date = min(date), max_date = max(date))
electricity_by_time <- hourly_electricity %>%
filter(solar_year == 1 | solar_year == 2) %>%
#filter(date <= as.POSIXct('12/31/2022 00:00',format="%m/%d/%Y %H:%M",tz=Sys.timezone()) ) %>%
group_by(time, solar_year) %>%
summarize(produced_kWh = mean(produced_kWh), consumed_kWh = mean(consumed_kWh), net_kWh = mean(net_kWh)) %>%
arrange(time)
`summarise()` has grouped output by 'time'. You can override using the `.groups` argument.
electricity_by_time
ggplot(electricity_by_time, aes(x=time, y=consumed_kWh, group=solar_year, color=solar_year)) +
geom_point()
#labs(colour="",x="Time of Day",y="Electricity Consumption (kWh)")+
#scale_color_manual(values = c("red","black","green")) +
#ggtitle("Home Electricity in 15-Minute Intervals (Since April 15, 2022)")
Wow, look how much less was used during the day in year 2!!! Like a 50% reduction!
Is this due to milder weather?
Let’s look at it by month:
#electricity_by_month <-
hourly_electricity %>%
mutate(month = month(date)) %>%
group_by(solar_year, month) %>%
summarize(consumed_kWh = mean(consumed_kWh)) %>%
arrange(month, solar_year) %>%
pivot_wider(names_from = month, values_from = consumed_kWh) %>%
arrange(solar_year)
`summarise()` has grouped output by 'solar_year'. You can override using the `.groups` argument.
#Look at limited window during day (no EV charging)
# hourly_electricity %>%
# filter(time == '12:00:00') %>%
# #filter(time > as.POSIXct('04:00:00',format="%H:%M:$s",tz=Sys.timezone()) ) %>% #& time < as.POSIXct('18:00',format="%H:%M",tz=Sys.timezone())) %>%
# mutate(month = month(date)) %>%
# group_by(solar_year, month) %>%
# summarize(consumed_kWh = mean(consumed_kWh)) %>%
# arrange(month, solar_year) %>%
# pivot_wider(names_from = month, values_from = consumed_kWh) %>%
# arrange(solar_year)
Look at specific months
electricity_by_month_time <- hourly_electricity %>%
mutate(month = as_factor(month(date))) %>%
filter(solar_year == 1 | solar_year == 2) %>%
#Sample month
filter(month == 6) %>%
group_by(solar_year, month, time) %>%
summarize(produced_kWh = mean(produced_kWh), consumed_kWh = mean(consumed_kWh), net_kWh = mean(net_kWh)) %>%
arrange(solar_year, month, time)
`summarise()` has grouped output by 'solar_year', 'month'. You can override using the `.groups` argument.
ggplot(electricity_by_month_time, aes(time, consumed_kWh, group=solar_year, color=solar_year)) +
#facet_grid(rows = vars(month)) +
geom_point(size=0.5) +
ggtitle("Home Electricity in 15-Minute Intervals") +
ylab("Electricity Consumption (kWh)")
Example day with EV charging
sample_day <- hourly_electricity %>%
filter(solar_year == 1 | solar_year == 2) %>%
filter(yday == 161) %>%
group_by(date, solar_year, yday, time) %>%
summarize(produced_kWh = mean(produced_kWh), consumed_kWh = mean(consumed_kWh), net_kWh = mean(net_kWh)) %>%
arrange(date, solar_year, yday, time)
`summarise()` has grouped output by 'date', 'solar_year', 'yday'. You can override using the `.groups` argument.
ggplot(sample_day, aes(time, consumed_kWh, group=solar_year, color=solar_year)) +
#facet_grid(rows = vars(month)) +
geom_point(size=0.5) +
ggtitle("Home Electricity in 15-Minute Intervals") +
ylab("Electricity Consumption (kWh)")
Ok, let’s detect and remove EV charging sessions.
Bayesian change point example
# library(onlineBcp)
x <- c(rnorm(10, 2.6, 0.2), rnorm(1, 2.6/2, 0.2) + rnorm(1, .2, .15), rnorm(86, .2, .15))
bcp <- online_cp(x)
summary(bcp)
[1] "Change points"
[1] "Segments"
begin end mean SD LL of CI UL of CI
[1,] 1 11 2.4159210 0.2461319 2.2938538 2.537988
[2,] 12 97 0.2128337 0.1483191 0.1865265 0.239141
bcp
$x
[1] 2.3720905715 2.4691440621 2.6071250448 2.5352472423 2.2877005354 2.3857597432 2.7419924694 2.3295656691
[9] 2.6664633812 2.3582885866 1.8217537652 0.0930585696 0.3230388724 0.0197739677 0.2570762359 0.1881634498
[17] 0.0792020254 0.1498961292 0.3642266363 0.3817626425 0.1885297288 0.3544041698 0.2879920055 0.0953605082
[25] 0.0446978082 0.0004123957 0.1959692210 0.0693755586 0.4736216346 0.1488568573 0.2188121995 0.0812417378
[33] 0.3080128352 0.4839328145 0.3567281316 0.0095019304 0.4530073963 0.3672416208 0.3294527060 0.1982238893
[41] 0.2996424154 0.1570348120 0.2920901580 0.2199320912 0.0822511010 0.4977626932 0.2455526621 0.4334779288
[49] 0.2376445401 0.2338382842 -0.0402372143 0.2225591660 0.1183037401 0.3194898662 0.1986949765 0.1917810490
[57] 0.0807082047 0.2332076344 -0.1524857206 0.0582340793 0.0665107477 0.0714005187 -0.0557819132 0.2851434290
[65] 0.3313943646 0.2103237245 -0.1036259056 0.1887882159 0.2929783093 0.0780226903 -0.1688743454 0.4017997097
[73] 0.3595800053 0.1888407383 0.1824374153 0.1784951176 0.1609317339 0.2098454959 0.3643482946 0.3487322792
[81] 0.2841377275 0.2780164560 0.0203063376 0.0949771645 0.2602946798 0.3359891574 0.1761905070 0.5173409818
[89] 0.1462872854 0.4356854056 0.1592010947 0.3728770785 0.2836787830 0.1263039884 0.4396970634 0.0967142059
[97] 0.2336566264
$max_p
[,1] [,2] [,3]
[1,] 0.9577733 0 0
[2,] 0.9383008 0 1
[3,] 0.9289778 0 2
[4,] 0.9231639 0 3
[5,] 0.9241976 0 4
[6,] 0.9287806 0 5
[7,] 0.9299975 0 6
[8,] 0.9358318 0 7
[9,] 0.9381648 0 8
[10,] 0.9254240 0 9
[11,] 0.4559258 0 10
[12,] 0.6111704 11 0
[13,] 0.8090391 11 1
[14,] 0.7996688 11 2
[15,] 0.7973283 11 3
[16,] 0.7991989 11 4
[17,] 0.8056386 11 5
[18,] 0.8089248 11 6
[19,] 0.8134703 11 7
[20,] 0.8252870 11 8
[21,] 0.8317779 11 9
[22,] 0.8411875 11 10
[23,] 0.8487528 11 11
[24,] 0.8538773 11 12
[25,] 0.8569608 11 13
[26,] 0.8680025 11 14
[27,] 0.8731902 11 15
[28,] 0.8663527 11 16
[29,] 0.8785399 11 17
[30,] 0.8858196 11 18
[31,] 0.8890118 11 19
[32,] 0.8923711 11 20
[33,] 0.8820230 11 21
[34,] 0.8895051 11 22
[35,] 0.8903923 11 23
[36,] 0.8879874 11 24
[37,] 0.8942148 11 25
[38,] 0.8993633 11 26
[39,] 0.9044254 11 27
[40,] 0.9066541 11 28
[41,] 0.9088015 11 29
[42,] 0.9107461 11 30
[43,] 0.9130828 11 31
[44,] 0.9113711 11 32
[45,] 0.9002217 11 33
[46,] 0.9116611 11 34
[47,] 0.9077451 11 35
[48,] 0.9147518 11 36
[49,] 0.9175931 11 37
[50,] 0.9030689 11 38
[51,] 0.9158742 11 39
[52,] 0.9176531 11 40
[53,] 0.9198118 11 41
[54,] 0.9222592 11 42
[55,] 0.9235917 11 43
[56,] 0.9208759 11 44
[57,] 0.9248626 11 45
[58,] 0.8835135 11 46
[59,] 0.9079202 11 47
[60,] 0.9164723 11 48
[61,] 0.9203609 11 49
[62,] 0.9085255 11 50
[63,] 0.9224407 11 51
[64,] 0.9244629 11 52
[65,] 0.9285093 11 53
[66,] 0.9042838 11 54
[67,] 0.9240923 11 55
[68,] 0.9277552 11 56
[69,] 0.9275764 11 57
[70,] 0.8848931 11 58
[71,] 0.9081096 11 59
[72,] 0.9189911 11 60
[73,] 0.9283150 11 61
[74,] 0.9312630 11 62
[75,] 0.9325588 11 63
[76,] 0.9331760 11 64
[77,] 0.9340624 11 65
[78,] 0.9292055 11 66
[79,] 0.9290267 11 67
[80,] 0.9322733 11 68
[81,] 0.9335335 11 69
[82,] 0.9274462 11 70
[83,] 0.9314169 11 71
[84,] 0.9346385 11 72
[85,] 0.9326805 11 73
[86,] 0.9357910 11 74
[87,] 0.9075830 11 75
[88,] 0.9290786 11 76
[89,] 0.9214965 11 77
[90,] 0.9325243 11 78
[91,] 0.9300501 11 79
[92,] 0.9343632 11 80
[93,] 0.9350886 11 81
[94,] 0.9243810 11 82
[95,] 0.9313401 11 83
[96,] 0.9362280 11 84
[97,] 0.0000000 0 0
$parameters
theta alpha beta th_cp
0.9 1.0 1.0 0.5
$series_length
[1] 97
$result
NULL
attr(,"class")
[1] "BayesCP"
Test on electricity consumption data
# library(onlineBcp)
#Select a sample to test
sample <- hourly_electricity %>%
mutate(solar_day = interval(as_date(as.POSIXct('04/15/2022',format="%m/%d/%Y",tz=Sys.timezone())),as_date(date)) / days(1) ) %>%
filter(solar_year == 2) %>%
filter(yday < 40 & yday > 35)
ggplot(sample, aes(datetime, consumed_kWh, group=solar_year, color=solar_year)) +
#facet_grid(rows = vars(month)) +
geom_point(size=0.5) +
ggtitle("Home Electricity in 15-Minute Intervals") +
ylab("Electricity Consumption (kWh)")
min_time <- pull(sample %>% summarize(min_time = min(datetime)))
sample <- sample %>%
mutate(time_x = interval(min_time,datetime)/minutes(15)+1)
#Filter data to feed to model
x <- sample %>%
ungroup() %>%
select(consumed_kWh)
x <- x$consumed_kWh
#Run online Bayesian Change Point model
#"Online" means in progress, not retroactive
bcp <- online_cp(x)
summary(bcp)
[1] "Change points"
[1] "Segments"
begin end mean SD LL of CI UL of CI
[1,] 1 22 0.3472727 0.16365416 0.2898818 0.4046636
[2,] 23 71 0.3963061 0.67936742 0.2366690 0.5559433
[3,] 72 86 2.6233333 0.28189833 2.5036113 2.7430554
[4,] 87 118 0.3384375 0.19605972 0.2814289 0.3954461
[5,] 119 131 1.6671538 0.69094740 1.3519434 1.9823643
[6,] 132 204 0.4050959 0.23258679 0.3603193 0.4498725
[7,] 205 226 1.2519091 0.87005845 0.9467935 1.5570246
[8,] 227 266 0.1373750 0.03542973 0.1281606 0.1465894
[9,] 267 279 2.5607692 0.44376160 2.3583250 2.7632134
[10,] 280 320 0.6154390 0.70612095 0.4340486 0.7968295
[11,] 321 384 0.2414844 0.21893980 0.1964689 0.2864999
plot(summary(bcp))
[1] "Change points"
[1] "Segments"
begin end mean SD LL of CI UL of CI
[1,] 1 22 0.3472727 0.16365416 0.2898818 0.4046636
[2,] 23 71 0.3963061 0.67936742 0.2366690 0.5559433
[3,] 72 86 2.6233333 0.28189833 2.5036113 2.7430554
[4,] 87 118 0.3384375 0.19605972 0.2814289 0.3954461
[5,] 119 131 1.6671538 0.69094740 1.3519434 1.9823643
[6,] 132 204 0.4050959 0.23258679 0.3603193 0.4498725
[7,] 205 226 1.2519091 0.87005845 0.9467935 1.5570246
[8,] 227 266 0.1373750 0.03542973 0.1281606 0.1465894
[9,] 267 279 2.5607692 0.44376160 2.3583250 2.7632134
[10,] 280 320 0.6154390 0.70612095 0.4340486 0.7968295
[11,] 321 384 0.2414844 0.21893980 0.1964689 0.2864999
Not too bad! It picks up the EV charging sessions, but it also picks up some other, presumably HVAC-related consumption changes. It looks like I should be able to weed these out easily.
#Select a sample to test
sample <- hourly_electricity %>%
mutate(solar_day = interval(as_date(as.POSIXct('04/15/2022',format="%m/%d/%Y",tz=Sys.timezone())),as_date(date)) / days(1) ) %>%
filter(solar_year == 2)
ggplot(sample, aes(datetime, consumed_kWh, group=solar_year, color=solar_year)) +
#facet_grid(rows = vars(month)) +
geom_point(size=0.5) +
ggtitle("Home Electricity in 15-Minute Intervals") +
ylab("Electricity Consumption (kWh)")
min_time <- pull(sample %>% summarize(min_time = min(datetime)))
sample <- sample %>%
mutate(time_x = interval(min_time,datetime)/minutes(15)+1)
#Filter data to feed to model
x <- sample %>%
ungroup() %>%
select(consumed_kWh)
x <- x$consumed_kWh
#Run online Bayesian Change Point model
#"Online" means in progress, not retroactive
bcp <- online_cp(x)
summary(bcp)
[1] "Change points"
[1] "Segments"
begin end mean SD LL of CI UL of CI
[1,] 1 183 0.15867213 0.08151452 0.14876069 0.16858357
[2,] 184 201 2.54833333 0.18683903 2.47589664 2.62077003
[3,] 202 255 0.21370370 0.13612198 0.18323467 0.24417273
[4,] 256 280 0.98676000 0.85564446 0.70527802 1.26824198
[5,] 281 310 0.09933333 0.01595972 0.09454050 0.10412616
[6,] 311 317 1.39928571 0.58181002 1.03757661 1.76099482
[7,] 318 407 0.19588889 0.11159210 0.17654074 0.21523704
[8,] 408 419 0.60500000 0.27843067 0.47279323 0.73720677
[9,] 420 465 0.13995652 0.08194794 0.12008247 0.15983057
[10,] 466 470 0.81600000 0.10968136 0.73531829 0.89668171
[11,] 471 525 0.12314545 0.05444005 0.11107109 0.13521982
[12,] 526 547 0.54072727 0.35733620 0.41541519 0.66603935
[13,] 548 663 0.14043103 0.08869638 0.12688525 0.15397682
[14,] 664 671 0.77875000 0.07972049 0.73238906 0.82511094
[15,] 672 739 0.19141176 0.16167936 0.15916194 0.22366159
[16,] 740 758 1.01136842 0.47855804 0.83078201 1.19195484
[17,] 759 799 0.28295122 0.15253933 0.24376646 0.32213598
[18,] 800 836 0.24978378 0.25941603 0.17963451 0.31993306
[19,] 837 887 0.15256863 0.12176408 0.12452325 0.18061401
[20,] 888 889 1.63700000 0.22203153 1.37875798 1.89524202
[21,] 890 1004 0.30826957 0.26276249 0.26796616 0.34857297
[22,] 1005 1276 0.17872059 0.12311218 0.16644213 0.19099905
[23,] 1277 1313 0.14602703 0.17472510 0.09877922 0.19327484
[24,] 1314 1333 0.83575000 0.64251405 0.59943304 1.07206696
[25,] 1334 1353 2.52600000 0.15367087 2.46947978 2.58252022
[26,] 1354 1411 0.15462069 0.19762234 0.11193824 0.19730314
[27,] 1412 1420 0.81455556 0.32066654 0.63873905 0.99037206
[28,] 1421 1470 0.16828000 0.06658432 0.15279133 0.18376867
[29,] 1471 1559 0.31550562 0.25288347 0.27141434 0.35959690
[30,] 1560 1564 1.17880000 0.19822386 1.03298635 1.32461365
[31,] 1565 1614 0.14046000 0.07016459 0.12413849 0.15678151
[32,] 1615 1624 1.20980000 0.08634530 1.16488763 1.25471237
[33,] 1625 1686 0.18277419 0.14634021 0.15220422 0.21334417
[34,] 1687 1698 3.15425000 0.49666051 2.91842151 3.39007849
[35,] 1699 1854 0.15433974 0.06694095 0.14552404 0.16315544
[36,] 1855 1861 0.84342857 0.21794790 0.70793118 0.97892596
[37,] 1862 1908 0.09882979 0.08260654 0.07901028 0.11864929
[38,] 1909 1926 2.59166667 0.16059632 2.52940416 2.65392917
[39,] 1927 2101 0.15522286 0.17138946 0.13391242 0.17653329
[40,] 2102 2200 0.17367677 0.17937310 0.14402388 0.20332965
[41,] 2201 2218 2.46388889 0.34700634 2.32935602 2.59842176
[42,] 2219 2264 0.18486957 0.07748623 0.16607757 0.20366156
[43,] 2265 2476 0.19737264 0.16586218 0.17863535 0.21610993
[44,] 2477 2479 0.75833333 0.45885219 0.32258128 1.19408538
[45,] 2480 2495 2.76906250 0.35950326 2.62122994 2.91689506
[46,] 2496 2572 0.13181818 0.05257044 0.12196393 0.14167243
[47,] 2573 2594 0.47481818 0.25175189 0.38653283 0.56310353
[48,] 2595 2677 0.14198795 0.09708150 0.12446026 0.15951564
[49,] 2678 2683 0.84000000 0.21071308 0.69850434 0.98149566
[50,] 2684 2759 0.13947368 0.06365333 0.12746372 0.15148364
[51,] 2760 2779 3.07070000 0.77736005 2.78478662 3.35661338
[52,] 2780 3060 0.12311388 0.06383092 0.11685055 0.12937721
[53,] 3061 3081 2.59571429 0.44914999 2.43449797 2.75693061
[54,] 3082 3147 0.13696970 0.06288108 0.12423832 0.14970107
[55,] 3148 3172 0.24856000 0.18372082 0.18812123 0.30899877
[56,] 3173 3524 0.09061648 0.04654004 0.08653627 0.09469669
[57,] 3525 3638 0.20732456 0.17125908 0.18094130 0.23370782
[58,] 3639 3640 1.27500000 0.37476659 0.83911379 1.71088621
[59,] 3641 3732 0.17995652 0.12108910 0.15919121 0.20072183
[60,] 3733 3751 2.60526316 0.13226104 2.55535375 2.65517256
[61,] 3752 3878 0.09667717 0.04120196 0.09066344 0.10269089
[62,] 3879 3895 0.56470588 0.29951435 0.44521894 0.68419282
[63,] 3896 4020 0.17004800 0.12667222 0.15141196 0.18868404
[64,] 4021 4034 2.63500000 0.12882606 2.57836734 2.69163266
[65,] 4035 4201 0.20934132 0.15551561 0.18954689 0.22913575
[66,] 4202 4218 3.13858824 0.60423765 2.89753633 3.37964014
[67,] 4219 4290 0.16494444 0.10834763 0.14394149 0.18594740
[68,] 4291 4312 0.59354545 0.35545045 0.46889468 0.71819623
[69,] 4313 4404 0.16091304 0.09404718 0.14478510 0.17704099
[70,] 4405 4608 0.25860784 0.20945656 0.23448624 0.28272945
[71,] 4609 4623 2.61266667 0.45051505 2.42133320 2.80400013
[72,] 4624 4697 0.17281081 0.12154662 0.14956984 0.19605178
[73,] 4698 4704 0.91428571 0.11222851 0.84451367 0.98405776
[74,] 4705 4787 0.12692771 0.11129425 0.10683396 0.14702146
[75,] 4788 4793 0.77833333 0.16154463 0.66985471 0.88681195
[76,] 4794 4888 0.12975789 0.07625402 0.11688939 0.14262640
[77,] 4889 4907 2.49736842 0.43878421 2.33179087 2.66294597
[78,] 4908 5214 0.13712378 0.08533592 0.12911272 0.14513484
[79,] 5215 5228 2.41135714 0.49351387 2.19440567 2.62830862
[80,] 5229 5362 0.23662687 0.18332709 0.21057724 0.26267649
[81,] 5363 5377 2.77400000 0.34652973 2.62682904 2.92117096
[82,] 5378 5464 0.21665517 0.22068165 0.17773867 0.25557168
[83,] 5465 5651 0.17728342 0.11530101 0.16341460 0.19115224
[84,] 5652 5668 2.57411765 0.26923639 2.46670966 2.68152563
[85,] 5669 5741 0.13509589 0.08354526 0.11901213 0.15117965
[86,] 5742 5748 1.17614286 0.12781683 1.09667961 1.25560610
[87,] 5749 6096 0.17443103 0.15804380 0.16049577 0.18836630
[88,] 6097 6112 2.60718750 0.45955823 2.41821100 2.79616400
[89,] 6113 6124 0.29750000 0.20276027 0.20122368 0.39377632
[90,] 6125 6131 2.76257143 0.97367703 2.15724009 3.36790277
[91,] 6132 6231 0.24848000 0.25669557 0.20625734 0.29070266
[92,] 6232 6308 0.21520779 0.12653378 0.19148923 0.23892636
[93,] 6309 6511 0.19472414 0.17713057 0.17427511 0.21517317
[94,] 6512 6525 2.48407143 0.27672159 2.36242306 2.60571980
[95,] 6526 6671 0.14185616 0.08498146 0.13028772 0.15342461
[96,] 6672 6673 0.92100000 0.22910260 0.65453371 1.18746629
[97,] 6674 6879 0.27940291 0.23138322 0.25288584 0.30591998
[98,] 6880 6900 2.72452381 0.68929207 2.47711173 2.97193589
[99,] 6901 7075 0.21150857 0.14219340 0.19382835 0.22918879
[100,] 7076 7095 0.52810000 0.34191826 0.40234231 0.65385769
[101,] 7096 7153 0.19832759 0.12769857 0.17074727 0.22590791
[102,] 7154 7179 0.59700000 0.26742042 0.51073490 0.68326510
[103,] 7180 7280 0.25075248 0.19670305 0.21855827 0.28294668
[104,] 7281 7298 2.83583333 0.19686730 2.75950872 2.91215794
[105,] 7299 7550 0.24308730 0.18568744 0.22384710 0.26232750
[106,] 7551 7563 1.10323077 0.43770579 0.90354925 1.30291229
[107,] 7564 7581 2.75872222 0.75105877 2.46753995 3.04990449
[108,] 7582 7913 0.33763253 0.19658596 0.31988611 0.35537895
[109,] 7914 8044 0.38840458 0.28637675 0.34724894 0.42956022
[110,] 8045 8054 0.72430000 0.23386608 0.60265493 0.84594507
[111,] 8055 8253 0.29678392 0.22912889 0.27006736 0.32350048
[112,] 8254 8278 2.59120000 0.29066476 2.49557980 2.68682020
[113,] 8279 8542 0.35060985 0.24308582 0.32600136 0.37521834
[114,] 8543 8557 2.57466667 0.41889083 2.39676399 2.75256934
[115,] 8558 8620 0.61955556 0.44157080 0.52804792 0.71106319
[116,] 8621 8801 0.31927624 0.21471628 0.29302482 0.34552767
[117,] 8802 8819 0.44194444 0.27913743 0.33372406 0.55016483
[118,] 8820 8833 2.71357143 0.18002594 2.63443101 2.79271185
[119,] 8834 9006 0.38552023 0.36266991 0.34016622 0.43087424
[120,] 9007 9024 2.85411111 0.24699366 2.75835273 2.94986950
[121,] 9025 9120 0.50219792 0.39500832 0.43588504 0.56851080
[122,] 9121 9394 0.44655474 0.30289382 0.41645642 0.47665307
[123,] 9395 9416 2.67545455 0.27109526 2.58038578 2.77052331
[124,] 9417 9555 0.29738129 0.19514767 0.27015533 0.32460726
[125,] 9556 9636 0.41034568 0.31565975 0.35265522 0.46803613
[126,] 9637 9651 2.56346667 0.59115128 2.31240508 2.81452825
[127,] 9652 9872 0.33284615 0.26946999 0.30303069 0.36266161
[128,] 9873 9888 2.66875000 0.28710590 2.55068820 2.78681180
[129,] 9889 10028 0.36028571 0.25706952 0.32454907 0.39602236
[130,] 10029 10165 0.43079562 0.35885920 0.38036538 0.48122586
[131,] 10166 10230 0.22975385 0.22577014 0.18369245 0.27581524
[132,] 10231 10239 2.54944444 0.65648993 2.18950116 2.90938773
[133,] 10240 10251 0.39150000 0.11319693 0.33775089 0.44524911
[134,] 10252 10253 2.40100000 0.66326616 1.62956365 3.17243635
[135,] 10254 10268 0.36380000 0.22700824 0.26738974 0.46021026
[136,] 10269 10284 2.63562500 0.05303694 2.61381550 2.65743450
[137,] 10285 10342 0.18908621 0.15608166 0.15537571 0.22279670
[138,] 10343 10353 0.79100000 0.26893977 0.65762146 0.92437854
[139,] 10354 10454 0.26540594 0.17848794 0.23619299 0.29461889
[140,] 10455 10469 2.47533333 0.51804394 2.25532039 2.69534627
[141,] 10470 10556 0.21736782 0.17195937 0.18704333 0.24769230
[142,] 10557 10564 0.83000000 0.09471763 0.77491757 0.88508243
[143,] 10565 10733 0.23657396 0.16448399 0.21576227 0.25738566
[144,] 10734 10751 2.71350000 0.26413148 2.61109735 2.81590265
[145,] 10752 11007 0.24485938 0.19501390 0.22481129 0.26490746
[146,] 11008 11099 0.34401087 0.26032564 0.29936819 0.38865355
[147,] 11100 11113 0.62950000 0.35320854 0.47422754 0.78477246
[148,] 11114 11134 2.76833333 1.03796514 2.39576977 3.14089690
[149,] 11135 11475 0.19822287 0.15181241 0.18470036 0.21174539
[150,] 11476 11814 0.22865192 0.16220743 0.21416092 0.24314291
[151,] 11815 12283 0.25126013 0.25484719 0.23190390 0.27061635
[152,] 12284 12548 0.23289811 0.15962050 0.21676965 0.24902658
[153,] 12549 12555 0.82357143 0.16277065 0.72237753 0.92476533
[154,] 12556 12678 0.54259350 0.90770922 0.40796982 0.67721717
[155,] 12679 12900 0.29581982 0.20082277 0.27364992 0.31798972
[156,] 12901 12906 0.90800000 0.11360282 0.83171472 0.98428528
[157,] 12907 13038 0.25925758 0.15798017 0.23664017 0.28187499
[158,] 13039 13056 2.66222222 0.35552042 2.52438848 2.80005597
[159,] 13057 13212 0.28707692 0.19893726 0.26087814 0.31327570
[160,] 13213 13423 0.26396209 0.23014310 0.23790151 0.29002266
[161,] 13424 13435 2.69416667 0.11325421 2.64039036 2.74794297
[162,] 13436 13473 0.10865789 0.02613507 0.10168426 0.11563153
[163,] 13474 13608 0.48853333 0.33009530 0.44180291 0.53526376
[164,] 13609 13624 2.92675000 0.37486984 2.77259849 3.08090151
[165,] 13625 13815 0.44051832 0.26973837 0.40841476 0.47262189
[166,] 13816 14006 0.38752880 0.17509618 0.36668930 0.40836829
[ reached getOption("max.print") -- omitted 355 rows ]
plot(summary(bcp))
[1] "Change points"
[1] "Segments"
begin end mean SD LL of CI UL of CI
[1,] 1 183 0.15867213 0.08151452 0.14876069 0.16858357
[2,] 184 201 2.54833333 0.18683903 2.47589664 2.62077003
[3,] 202 255 0.21370370 0.13612198 0.18323467 0.24417273
[4,] 256 280 0.98676000 0.85564446 0.70527802 1.26824198
[5,] 281 310 0.09933333 0.01595972 0.09454050 0.10412616
[6,] 311 317 1.39928571 0.58181002 1.03757661 1.76099482
[7,] 318 407 0.19588889 0.11159210 0.17654074 0.21523704
[8,] 408 419 0.60500000 0.27843067 0.47279323 0.73720677
[9,] 420 465 0.13995652 0.08194794 0.12008247 0.15983057
[10,] 466 470 0.81600000 0.10968136 0.73531829 0.89668171
[11,] 471 525 0.12314545 0.05444005 0.11107109 0.13521982
[12,] 526 547 0.54072727 0.35733620 0.41541519 0.66603935
[13,] 548 663 0.14043103 0.08869638 0.12688525 0.15397682
[14,] 664 671 0.77875000 0.07972049 0.73238906 0.82511094
[15,] 672 739 0.19141176 0.16167936 0.15916194 0.22366159
[16,] 740 758 1.01136842 0.47855804 0.83078201 1.19195484
[17,] 759 799 0.28295122 0.15253933 0.24376646 0.32213598
[18,] 800 836 0.24978378 0.25941603 0.17963451 0.31993306
[19,] 837 887 0.15256863 0.12176408 0.12452325 0.18061401
[20,] 888 889 1.63700000 0.22203153 1.37875798 1.89524202
[21,] 890 1004 0.30826957 0.26276249 0.26796616 0.34857297
[22,] 1005 1276 0.17872059 0.12311218 0.16644213 0.19099905
[23,] 1277 1313 0.14602703 0.17472510 0.09877922 0.19327484
[24,] 1314 1333 0.83575000 0.64251405 0.59943304 1.07206696
[25,] 1334 1353 2.52600000 0.15367087 2.46947978 2.58252022
[26,] 1354 1411 0.15462069 0.19762234 0.11193824 0.19730314
[27,] 1412 1420 0.81455556 0.32066654 0.63873905 0.99037206
[28,] 1421 1470 0.16828000 0.06658432 0.15279133 0.18376867
[29,] 1471 1559 0.31550562 0.25288347 0.27141434 0.35959690
[30,] 1560 1564 1.17880000 0.19822386 1.03298635 1.32461365
[31,] 1565 1614 0.14046000 0.07016459 0.12413849 0.15678151
[32,] 1615 1624 1.20980000 0.08634530 1.16488763 1.25471237
[33,] 1625 1686 0.18277419 0.14634021 0.15220422 0.21334417
[34,] 1687 1698 3.15425000 0.49666051 2.91842151 3.39007849
[35,] 1699 1854 0.15433974 0.06694095 0.14552404 0.16315544
[36,] 1855 1861 0.84342857 0.21794790 0.70793118 0.97892596
[37,] 1862 1908 0.09882979 0.08260654 0.07901028 0.11864929
[38,] 1909 1926 2.59166667 0.16059632 2.52940416 2.65392917
[39,] 1927 2101 0.15522286 0.17138946 0.13391242 0.17653329
[40,] 2102 2200 0.17367677 0.17937310 0.14402388 0.20332965
[41,] 2201 2218 2.46388889 0.34700634 2.32935602 2.59842176
[42,] 2219 2264 0.18486957 0.07748623 0.16607757 0.20366156
[43,] 2265 2476 0.19737264 0.16586218 0.17863535 0.21610993
[44,] 2477 2479 0.75833333 0.45885219 0.32258128 1.19408538
[45,] 2480 2495 2.76906250 0.35950326 2.62122994 2.91689506
[46,] 2496 2572 0.13181818 0.05257044 0.12196393 0.14167243
[47,] 2573 2594 0.47481818 0.25175189 0.38653283 0.56310353
[48,] 2595 2677 0.14198795 0.09708150 0.12446026 0.15951564
[49,] 2678 2683 0.84000000 0.21071308 0.69850434 0.98149566
[50,] 2684 2759 0.13947368 0.06365333 0.12746372 0.15148364
[51,] 2760 2779 3.07070000 0.77736005 2.78478662 3.35661338
[52,] 2780 3060 0.12311388 0.06383092 0.11685055 0.12937721
[53,] 3061 3081 2.59571429 0.44914999 2.43449797 2.75693061
[54,] 3082 3147 0.13696970 0.06288108 0.12423832 0.14970107
[55,] 3148 3172 0.24856000 0.18372082 0.18812123 0.30899877
[56,] 3173 3524 0.09061648 0.04654004 0.08653627 0.09469669
[57,] 3525 3638 0.20732456 0.17125908 0.18094130 0.23370782
[58,] 3639 3640 1.27500000 0.37476659 0.83911379 1.71088621
[59,] 3641 3732 0.17995652 0.12108910 0.15919121 0.20072183
[60,] 3733 3751 2.60526316 0.13226104 2.55535375 2.65517256
[61,] 3752 3878 0.09667717 0.04120196 0.09066344 0.10269089
[62,] 3879 3895 0.56470588 0.29951435 0.44521894 0.68419282
[63,] 3896 4020 0.17004800 0.12667222 0.15141196 0.18868404
[64,] 4021 4034 2.63500000 0.12882606 2.57836734 2.69163266
[65,] 4035 4201 0.20934132 0.15551561 0.18954689 0.22913575
[66,] 4202 4218 3.13858824 0.60423765 2.89753633 3.37964014
[67,] 4219 4290 0.16494444 0.10834763 0.14394149 0.18594740
[68,] 4291 4312 0.59354545 0.35545045 0.46889468 0.71819623
[69,] 4313 4404 0.16091304 0.09404718 0.14478510 0.17704099
[70,] 4405 4608 0.25860784 0.20945656 0.23448624 0.28272945
[71,] 4609 4623 2.61266667 0.45051505 2.42133320 2.80400013
[72,] 4624 4697 0.17281081 0.12154662 0.14956984 0.19605178
[73,] 4698 4704 0.91428571 0.11222851 0.84451367 0.98405776
[74,] 4705 4787 0.12692771 0.11129425 0.10683396 0.14702146
[75,] 4788 4793 0.77833333 0.16154463 0.66985471 0.88681195
[76,] 4794 4888 0.12975789 0.07625402 0.11688939 0.14262640
[77,] 4889 4907 2.49736842 0.43878421 2.33179087 2.66294597
[78,] 4908 5214 0.13712378 0.08533592 0.12911272 0.14513484
[79,] 5215 5228 2.41135714 0.49351387 2.19440567 2.62830862
[80,] 5229 5362 0.23662687 0.18332709 0.21057724 0.26267649
[81,] 5363 5377 2.77400000 0.34652973 2.62682904 2.92117096
[82,] 5378 5464 0.21665517 0.22068165 0.17773867 0.25557168
[83,] 5465 5651 0.17728342 0.11530101 0.16341460 0.19115224
[84,] 5652 5668 2.57411765 0.26923639 2.46670966 2.68152563
[85,] 5669 5741 0.13509589 0.08354526 0.11901213 0.15117965
[86,] 5742 5748 1.17614286 0.12781683 1.09667961 1.25560610
[87,] 5749 6096 0.17443103 0.15804380 0.16049577 0.18836630
[88,] 6097 6112 2.60718750 0.45955823 2.41821100 2.79616400
[89,] 6113 6124 0.29750000 0.20276027 0.20122368 0.39377632
[90,] 6125 6131 2.76257143 0.97367703 2.15724009 3.36790277
[91,] 6132 6231 0.24848000 0.25669557 0.20625734 0.29070266
[92,] 6232 6308 0.21520779 0.12653378 0.19148923 0.23892636
[93,] 6309 6511 0.19472414 0.17713057 0.17427511 0.21517317
[94,] 6512 6525 2.48407143 0.27672159 2.36242306 2.60571980
[95,] 6526 6671 0.14185616 0.08498146 0.13028772 0.15342461
[96,] 6672 6673 0.92100000 0.22910260 0.65453371 1.18746629
[97,] 6674 6879 0.27940291 0.23138322 0.25288584 0.30591998
[98,] 6880 6900 2.72452381 0.68929207 2.47711173 2.97193589
[99,] 6901 7075 0.21150857 0.14219340 0.19382835 0.22918879
[100,] 7076 7095 0.52810000 0.34191826 0.40234231 0.65385769
[101,] 7096 7153 0.19832759 0.12769857 0.17074727 0.22590791
[102,] 7154 7179 0.59700000 0.26742042 0.51073490 0.68326510
[103,] 7180 7280 0.25075248 0.19670305 0.21855827 0.28294668
[104,] 7281 7298 2.83583333 0.19686730 2.75950872 2.91215794
[105,] 7299 7550 0.24308730 0.18568744 0.22384710 0.26232750
[106,] 7551 7563 1.10323077 0.43770579 0.90354925 1.30291229
[107,] 7564 7581 2.75872222 0.75105877 2.46753995 3.04990449
[108,] 7582 7913 0.33763253 0.19658596 0.31988611 0.35537895
[109,] 7914 8044 0.38840458 0.28637675 0.34724894 0.42956022
[110,] 8045 8054 0.72430000 0.23386608 0.60265493 0.84594507
[111,] 8055 8253 0.29678392 0.22912889 0.27006736 0.32350048
[112,] 8254 8278 2.59120000 0.29066476 2.49557980 2.68682020
[113,] 8279 8542 0.35060985 0.24308582 0.32600136 0.37521834
[114,] 8543 8557 2.57466667 0.41889083 2.39676399 2.75256934
[115,] 8558 8620 0.61955556 0.44157080 0.52804792 0.71106319
[116,] 8621 8801 0.31927624 0.21471628 0.29302482 0.34552767
[117,] 8802 8819 0.44194444 0.27913743 0.33372406 0.55016483
[118,] 8820 8833 2.71357143 0.18002594 2.63443101 2.79271185
[119,] 8834 9006 0.38552023 0.36266991 0.34016622 0.43087424
[120,] 9007 9024 2.85411111 0.24699366 2.75835273 2.94986950
[121,] 9025 9120 0.50219792 0.39500832 0.43588504 0.56851080
[122,] 9121 9394 0.44655474 0.30289382 0.41645642 0.47665307
[123,] 9395 9416 2.67545455 0.27109526 2.58038578 2.77052331
[124,] 9417 9555 0.29738129 0.19514767 0.27015533 0.32460726
[125,] 9556 9636 0.41034568 0.31565975 0.35265522 0.46803613
[126,] 9637 9651 2.56346667 0.59115128 2.31240508 2.81452825
[127,] 9652 9872 0.33284615 0.26946999 0.30303069 0.36266161
[128,] 9873 9888 2.66875000 0.28710590 2.55068820 2.78681180
[129,] 9889 10028 0.36028571 0.25706952 0.32454907 0.39602236
[130,] 10029 10165 0.43079562 0.35885920 0.38036538 0.48122586
[131,] 10166 10230 0.22975385 0.22577014 0.18369245 0.27581524
[132,] 10231 10239 2.54944444 0.65648993 2.18950116 2.90938773
[133,] 10240 10251 0.39150000 0.11319693 0.33775089 0.44524911
[134,] 10252 10253 2.40100000 0.66326616 1.62956365 3.17243635
[135,] 10254 10268 0.36380000 0.22700824 0.26738974 0.46021026
[136,] 10269 10284 2.63562500 0.05303694 2.61381550 2.65743450
[137,] 10285 10342 0.18908621 0.15608166 0.15537571 0.22279670
[138,] 10343 10353 0.79100000 0.26893977 0.65762146 0.92437854
[139,] 10354 10454 0.26540594 0.17848794 0.23619299 0.29461889
[140,] 10455 10469 2.47533333 0.51804394 2.25532039 2.69534627
[141,] 10470 10556 0.21736782 0.17195937 0.18704333 0.24769230
[142,] 10557 10564 0.83000000 0.09471763 0.77491757 0.88508243
[143,] 10565 10733 0.23657396 0.16448399 0.21576227 0.25738566
[144,] 10734 10751 2.71350000 0.26413148 2.61109735 2.81590265
[145,] 10752 11007 0.24485938 0.19501390 0.22481129 0.26490746
[146,] 11008 11099 0.34401087 0.26032564 0.29936819 0.38865355
[147,] 11100 11113 0.62950000 0.35320854 0.47422754 0.78477246
[148,] 11114 11134 2.76833333 1.03796514 2.39576977 3.14089690
[149,] 11135 11475 0.19822287 0.15181241 0.18470036 0.21174539
[150,] 11476 11814 0.22865192 0.16220743 0.21416092 0.24314291
[151,] 11815 12283 0.25126013 0.25484719 0.23190390 0.27061635
[152,] 12284 12548 0.23289811 0.15962050 0.21676965 0.24902658
[153,] 12549 12555 0.82357143 0.16277065 0.72237753 0.92476533
[154,] 12556 12678 0.54259350 0.90770922 0.40796982 0.67721717
[155,] 12679 12900 0.29581982 0.20082277 0.27364992 0.31798972
[156,] 12901 12906 0.90800000 0.11360282 0.83171472 0.98428528
[157,] 12907 13038 0.25925758 0.15798017 0.23664017 0.28187499
[158,] 13039 13056 2.66222222 0.35552042 2.52438848 2.80005597
[159,] 13057 13212 0.28707692 0.19893726 0.26087814 0.31327570
[160,] 13213 13423 0.26396209 0.23014310 0.23790151 0.29002266
[161,] 13424 13435 2.69416667 0.11325421 2.64039036 2.74794297
[162,] 13436 13473 0.10865789 0.02613507 0.10168426 0.11563153
[163,] 13474 13608 0.48853333 0.33009530 0.44180291 0.53526376
[164,] 13609 13624 2.92675000 0.37486984 2.77259849 3.08090151
[165,] 13625 13815 0.44051832 0.26973837 0.40841476 0.47262189
[166,] 13816 14006 0.38752880 0.17509618 0.36668930 0.40836829
[ reached getOption("max.print") -- omitted 355 rows ]
onlineBcp model seems to change efficacy when looking across different lengths of time. It works well on single days, but when looking at a week, it picks up noise from HVAC/other appliances, though still picking up the EV charging pretty well. When looking at longer periods, however, the EV charging intervals get lost in the noise.
Also, the original bcp package for R was deprecated, leaving the best option as onlineBCP. Maybe build a training data set with manually labeled EV charging intervals, then run a machine learning model on the rest of the data set? Use time series inputs.
Identify streaks of high electricity usage (2 kWh in 15 minute interval and 2 kWh in previous and/or next interval)
sample <- sample %>%
mutate(next_net = lead(consumed_kWh, order_by = datetime), prev_net = lag(consumed_kWh, order_by = datetime)) %>%
#mutate(next2 = lead(consumed_kWh, order_by = datetime, n = 2L), next3 = lead(consumed_kWh, order_by = datetime, n = 3L)) %>%
#mutate(nexthour_net = consumed_kWh + next_net + next2 + next3) %>%
mutate(streak = case_when(consumed_kWh > 2 & (next_net > 2 | prev_net > 2) ~ 1)) %>%
#mutate(streak_net = ) %>%
#mutate(start_of_ev_charge = case_when(streak == 1 & is.na(lag(streak, order_by = datetime)) ~ datetime), #& nexthour_net >= 10000
# end_of_ev_charge = case_when(streak == 1 & is.na(lead(streak, order_by = datetime)) ~ end),
# ev_charge_time = 0, ev_charge_net = 0, ev_charge_min = 0, ev_charge_max = 0, customer_id = customer_id) %>%
arrange(datetime)
sample
Now, look at length of streaks to identify charging sessions. (not finished)
This doesn’t work yet: